package ru.beta2.testyard.engine.points;

/**
 * User: Inc
 * Date: 23.06.2008
 * Time: 3:12:15
 */
public class ExpectWholeChannelMessagePoint<T> extends ExpectMessagePoint<T>
{

    private final String channel;
    private final T message;

    public ExpectWholeChannelMessagePoint(String channel, T message)
    {
        super(null);
        this.channel = channel;
        this.message = message;
    }

    public void exec()
    {
        for (int player : link().getLoggedInPlayers()) {
            expectations().expectEvent(new MessageEvent(player, channel, message), this);
        }
    }
}
